package net.sparrow.event;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;

import net.sparrow.Sparrow;
import net.sparrow.module.Module;
import net.sparrow.util.Util;

public class SpListenerEntry {

	
	Module module;
	Method callback;
	
	public SpListenerEntry(Module m, Method c) {
		module = m;
		callback = c;
	}
	
	
	public void invoke(SpEvent e) {
		try {
			callback.invoke(module, e);
		} catch (Exception ex) {
			Util.print("Error dispatching an event!");
			ex.printStackTrace();
		}
	}
}
